﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="TJ_AJ_JCXH.aspx.cs" Inherits="IYAKASAPortal.Statistics.TJ_AJ_JCXH" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>成都弥荣科技发展有限公司--打印统计车辆种类</title>
    <link rel="stylesheet" href="../support/tfNiceTable/tfNiceTable.css" />
    <style type="text/css">
        body {
            overflow-y: scroll;
        }
    </style>
    <script type="text/javascript" src="../support/tfNiceTable/tfNiceTable.js"></script>
<script type="text/javascript" src="../script/jquery-3.2.1.min.js"></script>
    <script type="text/javascript">
        function doAjaxShow() {
            document.getElementById("divNiceTableMessage").style.left = $(window).width / 2;// window.parent.document.getElementById("mainContentFrame").scrollWidth/2-200;
            document.getElementById("divNiceTableMessage").style.top = $(window).height / 2;//window.parent.document.getElementById("mainContentFrame").scrollHeight/2-15;

            document.getElementById("divNiceTableMessage").style.display = "block";
        }

        $(function () {
            startSum("cjs", "lblCJS");
            startSum("hgs", "lblHGS");
            startDiv("lblHGS", "lblCJS", "lblHGL");
            startSum("yhgs", "lblYHGS");
            startDiv("lblYHGS", "lblCJS", "lblYHGL");
            startSum("ehgs", "lblEHGS");
            startDiv("lblEHGS", "lblCJS", "lblEHGL");
            startSum("shgs", "lblSHGS");
            startDiv("lblSHGS", "lblCJS", "lblSHGL");

            function startSum(trId, lblId) {
                var sum = 0;
                $("td[id='" + trId + "']").each(function () {
                    sum += parseInt($(this).text());
                });
                $("#" + lblId).text(sum);
            }

            function startDiv(lblgs, lblzs, result) {
                var res = 0, resgl = 0;
                res = parseInt($("#" + lblgs).text()) / parseInt($("#" + lblzs).text());
                resgl = (res * 100).toFixed(2);
                $("#" + result).text(resgl);
            }
        })
    </script>
</head>
<body>
    <form id="form1" runat="server">
        <asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
        <asp:UpdatePanel ID="UpdatePanel1" runat="server">
            <ContentTemplate>
                <input type="hidden" id="txtUniqueKey" name="txtUniqueKey" value="" />
                <div id="divNiceTableMessage" class="tfNiceTableMessage" style="display: none;">正在处理...</div>
                <table border="0" width="100%" cellpadding="0" cellspacing="0" style="height: 25px;">
                    <tr>
                        <td class="main_title_left"></td>
                        <td class="main_title_center">&nbsp;成都弥荣科技发展有限公司--检测线分类合格率汇总表(安检)</td>
                        <td class="main_title_right"></td>
                    </tr>
                </table>
                <table width="100%" cellpadding="0" cellspacing="0" border="0" class="mainWidth">
                    <tr>
                        <td>
                            <table class="table_without_border">
                                <tr>
                                    <td>
                                        <img src="../support/tfNiceTable/images/tfNiceTable_Search.gif" alt="" />
                                        开始时间:<asp:TextBox ID="txtStart" runat="server" onclick="InitData('#txtStart')"></asp:TextBox>
                                        结束日期:
                    <asp:TextBox ID="txtEnd" runat="server" onclick="InitData('#txtEnd')"></asp:TextBox>
                                        <asp:Button ID="btnSearch" runat="server" Text="" CssClass="btnSearch" OnClientClick="doAjaxShow();" OnClick="btnSearch_Click" />
                                        <asp:Button ID="btnSearchAll" runat="server" Text="" CssClass="btnSearchAll" OnClientClick="doAjaxShow();" OnClick = "btnSearchAll_Click"  />
                                    </td>
                                    <td align="right">
                                        <asp:Button ID="btnPrint" runat="server" Text="" CssClass="btnPrintEnabled" OnClientClick="doAjaxShow();" OnClick="btnPrint_Click" />
                                    </td>
                                </tr>
                            </table>
                            <table border="1" cellspacing="0" cellpadding="3" class="tfNiceTable">
                                <thead>
                                    <tr class="noborder">
                                        <td colspan="10" align="center" style="border: none">
                                            <asp:Label ID="lblTistle" Font-Size="1.4em" Font-Bold="True" runat="server" Text="检测线分类合格率汇总表(安检)"></asp:Label>
                                        </td>
                                    </tr>
                                    <tr class="noborder">
                                        <td colspan="6" style="padding-left: 25px;">
                                            <asp:Label ID="lblJGMC" runat="server" Font-Size="1.2em" Text="机动车安全技术检验机构名称:"></asp:Label></td>
                                        <td colspan="4">
                                            <asp:Label ID="lblTJ" runat="server" Font-Size="1.2em" Text="统计范围:"></asp:Label>
                                            <asp:Label ID="lblDate" runat="server" Font-Size="1.2em" Text=""></asp:Label>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td style="width:10%" align="center">线号</td>
                                        <td style="width:10%" align="center">初检(辆)</td>
                                        <td style="width:10%" align="center">合格(辆)</td>
                                        <td style="width:10%" align="center">合格率</td>
                                        <td style="width:10%" align="center">一次复检(辆)</td>
                                        <td style="width:10%" align="center">合格率</td>
                                        <td style="width:10%" align="center">二次复检(辆)</td>
                                        <td style="width:10%" align="center">合格率</td>
                                        <td style="width:10%" align="center">三次以上复检(辆)</td>
                                        <td style="width:10%" align="center">合格率</td>
                                    </tr>
                                </thead>
                                <tbody>
                                    <asp:Repeater ID="rptList" runat="server">
                                        <ItemTemplate>
                                            <tr style="cursor: pointer;">
                                           <td align="center"><%# DataBinder.Eval(Container.DataItem, "JCXH")%></td>
                                           <td align="center"><%# DataBinder.Eval(Container.DataItem, "InitialCheckNum")%></td>
                                           <td align="center"><%# DataBinder.Eval(Container.DataItem, "InitialCheckNumQualified")%></td>
                                           <td align="center"><%# DataBinder.Eval(Container.DataItem, "InitPercent")%></td>

                                           <td align="center"><%# DataBinder.Eval(Container.DataItem, "FirstReview")%></td>
                                           <td align="center"><%# DataBinder.Eval(Container.DataItem, "FirstPercent")%></td>

                                           <td align="center"><%# DataBinder.Eval(Container.DataItem, "SecondReview")%></td>
                                           <td align="center"><%# DataBinder.Eval(Container.DataItem, "SecondPercent")%></td>

                                           <td align="center"><%# DataBinder.Eval(Container.DataItem, "OtherReview")%></td>
                                           <td align="center"><%# DataBinder.Eval(Container.DataItem, "OtherPercent")%></td>  
                                    
                                            </tr>
                                        </ItemTemplate>
                                    </asp:Repeater>
                                </tbody>
                            </table>
                            <br />
                        </td>
                    </tr>
                </table>
            </ContentTemplate>
        </asp:UpdatePanel>
    </form>
</body>
</html>
<script type="text/javascript" src="../support/jedate/jedate.min.js"></script>
<script type="text/javascript" src="../script/jquery.validate.min.js"></script>
<script type="text/javascript">
    function InitData(oId) {
        jeDate({
            dateCell: oId,//isinitVal:true,
            format: "YYYY-MM-DD",
            isTime: true, //isClear:false,
            minDate: "2000-10-19",
            maxDate: "2099-11-8"
        });
    }

    jQuery(function () {
        jQuery.validator.methods.compareDate = function (value, element, param) {
            var startDate = jQuery(param).val();

            var date1 = new Date(Date.parse(startDate.replace("-", "/")));
            var date2 = new Date(Date.parse(value.replace("-", "/")));
            return date1 < date2;
        };

        jQuery("#form2").validate({
            focusInvalid: false,
            rules: {
                "txtStart": {
                    date: true
                },
                "txtEnd": {
                    date: true,
                    compareDate: "#txtStart"
                }
            },
            messages: {
                "txtStart": {
                    date: "时间格式错误!"
                },
                "txtEnd": {
                    date: "时间格式错误!",
                    compareDate: "结束日期必须大于开始日期!"
                }
            }
        });

    });
</script>
